<?php $this->placeholder('onReady')->captureStart() ?>
	$("#<?php echo $this->id_tablesorter?>").tablesorter(); 

    $("legend").hide()
    $("#idZona").hide();
    
    $("a.enlace_img").click(function (e) {
        e.preventDefault()
        var src=$(this).children().attr('src')
        src=src+'/json/1';
        location.href=src;
	}).css('cursor','pointer')
    
    
<?php $this->placeholder('onReady')->captureEnd() ?>



<?php



$this->headScript()->offsetSetFile(10,'https://www.google.com/jsapi','text/javascript');


$script = <<<SCRIPT
      google.load("visualization", "1", {packages:["corechart","table","controls"]});
      
      google.setOnLoadCallback(ocupacion);
      google.setOnLoadCallback(racks);
      


      


    function ocupacion() {
        
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Ocupación m2');
        data.addColumn('number', 'Ocupada');
        data.addColumn('number', 'Libre ');
        data.addRows(1);

        data.setValue(0, 0, '');
        data.setValue(0, 1, {$this->ocupacion['ocupado']['value']});
        data.setValue(0, 2, {$this->ocupacion['libre']['value']});

       var options = {
          title: 'Ocupación m2',
          'width':500,
          'height':300,
          'isStacked': true,
          legend: {position: 'right'},
          colors:['blue','green'],
          backgroundColor:'#FAFAFA',
          
          vAxis: {maxValue : {$this->ocupacion['total']['value']} , gridlines: { count: 10}}


        };

        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }    
      
      
      function racks() {
        
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Ocupación Racks');
        data.addColumn('number', 'Instalados');
        data.addColumn('number', 'Libres');
        data.addRows(1);

        data.setValue(0, 0, '');
        data.setValue(0, 1, {$this->racks['instalados']['value']});
        data.setValue(0, 2, {$this->racks['libres']['value']});

       var options = {
          title: 'Ocupacion Racks',
          'width':500,
          'height':300,
          'isStacked': true,
          legend: {position: 'right'},
          colors:['blue','green'],
          backgroundColor:'#FAFAFA',
          
          vAxis: {maxValue : {$this->racks['total']['value']} , gridlines: { count: 10}}


        };

        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div2'));
        chart.draw(data, options);
      }    
      
      
      
      
    

SCRIPT;

if($style)$this->headStyle()->appendStyle($style);
if($script)$this->headScript()->offsetSetScript(11,$script,'text/javascript');

?>




<?=$this->msg($this->translate('Sala').': '.$this->sala['nombre'],'head',null,false); ?>

<div class="contenedor_tablesorter">

<table width="100%" class="tabla_descriptiva_proyecto">
<tbody>
<tr>
	<th class="ui-state-hover"><?php echo $this->translate('Edificio');?></th><td class="ui-state-highlight"><?=$this->zona;?>&nbsp;</td>
    <th class="ui-state-hover"><?php echo $this->translate('Superficie Neta');?> m<sup>2</sup></th><td  class="ui-state-highlight"><?=$this->NumEs($this->ocupacion['total']['value'],2)?> m<sup>2</sup>&nbsp;</td>

</tr>
<tr>
	<th class="ui-state-hover"><?php echo $this->translate('Ubicacion');?></th><td class="ui-state-highlight"><?=$this->escape($this->sala['ubicacion']);?>&nbsp;</td>
    <th class="ui-state-hover"><?php echo $this->translate('Superficie ocupada clientes');?> m<sup>2</sup></th><td  class="ui-state-highlight"><?=$this->NumEs($this->ocupacion['clientes']['value'],2)?> m<sup>2</sup>&nbsp;</td>
</tr>	

<tr>
	<th class="ui-state-hover"><?php echo $this->translate('Sala');?></th><td class="ui-state-highlight"><?=$this->escape($this->sala['nombre']);?> <?=$this->editarFila('salas',$this->sala['id'],$this->idZona)?>&nbsp;</td>
    <th class="ui-state-hover"><?php echo $this->translate('Superficie servidumbre');?> m<sup>2</sup></th><td class="ui-state-highlight"><?=$this->NumEs($this->ocupacion['servidumbre']['value'],2)?> m<sup>2</sup>&nbsp;</td>

</tr>	
<tr>
    <th class="ui-state-hover"><?php echo $this->translate('Estado');?></th><td class="ui-state-highlight"><?=$this->escape($this->sala['estado']); ?>&nbsp;</td>
	<th class="ui-state-hover"><?php echo $this->translate('Superficies libre en sala');?> m<sup>2</sup></th><td class="ui-state-highlight"><?=$this->NumEs($this->ocupacion['libre']['value'],2)?> m<sup>2</sup>&nbsp;</td>
</tr>	
<tr>
 	<th class="ui-state-hover"><?php echo $this->translate('Tipo de Sala');?></th><td class="ui-state-highlight"><?=$this->escape($this->sala['tipo_sala']);?>&nbsp;</td>
  	<th class="ui-state-hover"><?php echo $this->translate('Nº Racks Totales');?></th><td class="ui-state-highlight"><?=$this->NumEs($this->racks['total']['value'],2)?>&nbsp;</td>
</tr>
<tr>
	<th class="ui-state-hover"><?php echo $this->translate('Fecha Actualización');?></th><td class="ui-state-highlight"><?=$this->dateTo($this->sala['f_update']);?>&nbsp;</td>
  	<th class="ui-state-hover"><?php echo $this->translate('Nº Racks existentes');?></th><td class="ui-state-highlight"><?=$this->NumEs($this->racks['instalados']['value'],2)?>&nbsp;</td>
</tr>
<tr>
    <th class="ui-state-hover"><?php echo $this->translate('Observaciones');?></th><td class="ui-state-highlight"><?=$this->text($this->sala['notas']); ?>&nbsp;</td>
  	<th class="ui-state-hover"><?php echo $this->translate('Nº posiciones libres');?></th><td class="ui-state-highlight"><?=$this->NumEs($this->racks['libres']['value'],2)?>&nbsp;</td>
</tr>
<tr>
	<th class="ui-state-hover"><?php echo $this->translate('Plano Sala Vacia');?></th><td class="ui-state-highlight"><?php echo $this->showPhotos('sala','vacia_'.$this->sala['id_zona'],$this->sala['id'],true,false,false);?></td>
  	<th class="ui-state-hover"><?php echo $this->translate('Plano Sala Actual');?></th><td class="ui-state-highlight"><?php echo $this->showPhotos('sala','actual_'.$this->sala['id_zona'],$this->sala['id'],true,false,false);?></td>
</tr>
<tr>
    <th class="ui-state-hover"><?php echo $this->translate('Nº CRACK');?></th><td class="ui-state-highlight"><?=$this->NumEs($this->sala['nclimas'],0)?>&nbsp;</td>
  	<th class="ui-state-hover"><?php echo $this->translate('Potencia CRACK kW');?></th><td class="ui-state-highlight"><?=$this->NumEs($this->sala['potencia_frio'],2)?>&nbsp;</td>
</tr>
<tr>
    <th class="ui-state-hover"><?php echo $this->translate('Filas x Columnas Plano');?></th><td class="ui-state-highlight"><?=$this->NumEs($this->sala['filas_plano'],0)?> x <?=$this->NumEs($this->sala['columnas_plano'],0)?></td>
  	<th class="ui-state-hover"><?php echo $this->translate('Huellas');?></th><td class="ui-state-highlight"><?=$this->NumEs($this->sala['filas_plano']*$this->sala['columnas_plano'],0)?>&nbsp;</td>
</tr>
<tr>
   <td colspan="2" valign="top"><div id="chart_div"></div></td>
  <td colspan="2" valign="top"><div id="chart_div2"></div></td>

</tr>
</tbody>	

	
</table>


<?=$this->msg('Clientes')?>


<table id="<?= $this->id_tablesorter?>" width="100%" class=""> 
    <caption>
       <div id="total_table_filter" style="float: right;"><?php echo $this->translate('Total');?> <span class="filtradas"><?=count($this->rack['activos'])?></span></div>    
    </caption>
    <thead>
		<tr>
			<th><?php echo $this->translate('Cliente');?></th> 
    		<th><?php echo $this->translate('Fecha Implantación');?></th> 
            <th><?php echo $this->translate('Superficie Ocupada');?></th> 
    		<th><?php echo $this->translate('Racks Intalados');?></th> 
    		<th><?php echo $this->translate('Posiciones Rack Libre');?></th> 
            <th><?php echo $this->translate('Total Racks');?></th>
            <th><?php echo $this->translate('Plano');?></th> 
            <th></th>
    	</tr>
    </thead>
    <tbody>
        <?php echo $this->partialLoop($this->controllerName.'/fila-informe.phtml',(array)$this->proyectos); ?>	
    </tbody>
    <tfoot>
    		<tr>
			<th></th> 
    		<th></th> 
            <th><?php echo $this->numEs($this->suma['sup_ocupada'],2);?></th> 
    		<th><?php echo $this->numEs($this->suma['racks_instalados'],2);?></th> 
    		<th><?php echo $this->numEs($this->suma['racks_libres'],2);?></th>  
            <th><?php echo $this->numEs($this->suma['racks_total'],2);?></th> 
            <th></th> 
            <th></th>
    	</tr>
    </tfoot>
</table>

</div>


<div class="tabla">
<div class="fila">
<div class="col"><a class="enlace_img"><img src="/grafico/salas/id/<?=$this->sala['id']?>/key/potencia/w/500" /></a></div>
<div class="col"><a class="enlace_img"><img src="/grafico/salas/id/<?=$this->sala['id']?>/key/consumo/w/500" /></a></div>
<div class="col"><a class="enlace_img"><img src="/grafico/salas/id/<?=$this->sala['id']?>/key/ratiowm2/w/500" /></a></div>
</div>
</div>
